<%@ LANGUAGE="JavaScript" codepage=65001%>
<!-- #include file="Config.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="all" />
<meta name="author" content="embont@gmail.com,dnxh" />
<meta name="Copyright" content="PJBlog2 CopyRight 2005" />
<meta name="keywords" content="天气预报,气象,城市天气预报,Weather,Google Earth,地球,地图" />
<meta name="description" content="Weather For Google Earth" />
<title>更新数据</title>
<body>
<%
var Vcode = Request.QueryString("code");
try{
        var oXHy = Server.CreateObject("Msxml2.ServerXMLHTTP");
        var url  = "http://xoap.weather.com/weather/local/" + Vcode + "?cc=*&unit=m&prod=xoap&par=" + Vpar + "&key=" + Vkey + "&dayf=10";
		oXHy.setTimeouts(1000,2000,1000,5000);		
		oXHy.open("GET",url,false);
        oXHy.send();
        var xml = Server.CreateObject("MSXML2.DOMDocument");
        xml.loadXML(oXHy.responseText);
		xml.save(Server.MapPath("xml/"+Vcode+".xml"))
		}catch(err){Response.write ("<div>连接数据服务器出错，更新失败！稍后<a href='updata.asp?code="+Vcode+"'>再试</a></div>")}
%>
<%
Response.write ("<div>更新成功！<br/><a href='#' onClick='window.close()'>关闭窗口</a></div>")
//Response.write ("<script>location.href('http://www.dnxh.cn/blog/LoadMod.asp?plugins=WeatherForGEarth')</script>")；
oXHy='';
xml='';
%>
</body>
</html>